package com.lxhll.personnel.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lxhll.personnel.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * (Employee)表数据库访问层
 *
 * @author makejava
 * @since 2021-07-18 15:06:39
 */
@Mapper
public interface EmployeeDao extends BaseMapper<Employee> {
    //分页
    public IPage<Map<String, Object>> queryEmployee(IPage<Map<String, Object>> page, @Param("map") Map<String, Object> params);


    //不分页，可以懒加载
    public List<Map<String, Object>> queryEmployee(@Param("map") Map<String, Object> params);

    //根据id查询
    public Employee getEmployeeById(Integer id);

    //查找离职员工，自定义sql
    @Select("select * from employee where id=#{id}")
    Employee getResignEmployeeById(Integer id);

}

